﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EPiServer.XmlRpc;

namespace TemplateFoundation.MetaWeblog
{
    /// <summary>
    /// Represents an author over MetaWeblog
    /// </summary>
    public class AuthorData : IEquatable<AuthorData>
    {
        /// <summary>
        /// User ID
        /// </summary>
        public int user_id { get; set; }

        /// <summary>
        /// Username
        /// </summary>
        public string user_login { get; set; }

        /// <summary>
        /// Display name
        /// </summary>
        public string display_name { get; set; }

        /// <summary>
        /// E-mail address
        /// </summary>
        public string user_email { get; set; }

        /// <summary>
        /// Meta value
        /// </summary>
        [XmlRpcMissingMapping(MappingAction.Ignore)]
        public string meta_value { get; set; }

        #region IEquatable<Author> Members

        /// <summary>
        /// Equalses the specified other.
        /// </summary>
        /// <param name="other">The other.</param>
        /// <returns></returns>
        public bool Equals(AuthorData other)
        {
            return user_login.Equals(other.user_login, StringComparison.OrdinalIgnoreCase);
        }

        #endregion
    }
}
